package com.timesheet.serverice;

import java.util.Calendar;

import com.timesheet.server.common.models.LeaveDTO;
import com.timesheet.server.common.session.Session;
import com.timesheet.server.dao.LeaveDao;

public class LeaveService {
	
	public boolean saveLeave(LeaveDTO leaveDTO) throws Exception{
		return new LeaveDao().saveLeave(leaveDTO);
	}
	
	public static void main(String[] args) {
		LeaveDTO leaveDTO = new LeaveDTO();
		leaveDTO.setLeaveId(new Long(33));
		leaveDTO.setEmployeeId(Session.INSTANCE.getUser());
		leaveDTO.setDayDate(Calendar.getInstance().getTime());
		leaveDTO.setLeaveType("d");
		try {
			new LeaveService().saveLeave(leaveDTO);
		} catch (Exception e) {			
			e.printStackTrace();
		}
		
		
	}

}
